package gui.cliente;

import dao.ClienteDAO;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ActualizarConsultar_Cliente extends HttpServlet {

    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        ClienteDAO bd = new ClienteDAO();
        String rfc;
        
        rfc = request.getParameter("rfc");               
                
        List<String> lista = bd.Juan(rfc);
        
            out.println("<form id='FormActualizar_Insertar' action='ActualizarInsertar_Cliente'>"+
                    "<table id=\"table1\" border=\"1\">"
                            +    "<tr>"
                            +        "<td><input type='text' id='nombre' name='nombre' value='"+lista.get(1)+"'/></td>"
                            +        "<td><input type='text' id='telefono' name='telefono' value='"+lista.get(2)+"'/></td>"
                            +        "<td><input type='text' id='email' name='email' value='"+lista.get(3)+"'/></td>"
                            +    "</tr>"
                            +    "<tr>"
                            +        "<td><input type='text' id='calle' name='calle' value='"+lista.get(4)+"'/></td>"
                            +        "<td><input type='text' id='noExterior' name='noExterior' value='"+lista.get(5)+"'/></td>"
                            +        "<td><input type='text' id='noInterior' name='noInterior' value='"+lista.get(6)+"'/></td>"
                            +    "</tr>"
                            +        "<td><input type='text' id='delegacion' name='delegacion' value='"+lista.get(7)+"'/></td>"
                            +        "<td><input type='text' id='cp' name='cp' value='"+lista.get(8)+"'/></td>"                            
                     +"</table>"
                           +"</form><br><div id=\"juan\"></div>"
                );                                                                
    }

}
